package com.dhcc.bpm.modules.metadata.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import org.springblade.core.mp.base.Excel;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.NullSerializer;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity;

/**
 * @ClassName Metadata
 * @Description 元数据表实体类
 * @Author daina
 * @Date 2020/2/21 14:16
 * @Version V1.0
 * @Copyright: 2020 东华软件 . All rights reserved.
 */
@Data
@TableName("opc_metadata")
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "Metadata对象", description = "元数据表")
public class Metadata extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 名称
     */
    @ApiModelProperty(value = "名称")
    @Excel(name = "元数据名称")
    private String fieldName;
    /**
     * 编号
     */
    @ApiModelProperty(value = "编号")
    @Excel(name = "元数据编码")
    private String fieldCode;
    /**
     * 类型
     */
    @ApiModelProperty(value = "类型")
    @Excel(name = "元数据类型", readConverterExp = "string=String,integer=Integer,double=Double,long=Long,enum=Enum,char=Char,byte=Byte,boolean=Boolean")
    private String fieldType;
    /**
     * 长度
     */
    @ApiModelProperty(value = "长度")
    @Excel(name = "长度")
    private String fieldLength;
    /**
     * 验证规则
     */
    @ApiModelProperty(value = "验证规则")
    @Excel(name = "验证规则")
    private String fieldValid;
    /**
     * 默认值
     */
    @ApiModelProperty(value = "默认值")
    @Excel(name = "默认值")
    private String defaultValue;
    /**
     * 父ID
     */
    @ApiModelProperty(value = "父ID")
    @Excel(name = "父节点")
    @JsonSerialize(
            using = ToStringSerializer.class,
            nullsUsing = NullSerializer.class
    )
    private Long parentId;
    /**
     * 排序字段
     */
    @ApiModelProperty(value = "排序字段")
    @Excel(name = "排序字段")
    private String orderNum;
    /**
     * 是否敏感数据
     */
    @ApiModelProperty(value = "是否敏感数据")
    @Excel(name = "是否敏感数据", readConverterExp = "0=否,1=是")
    private String sensData;
    /**
     * 枚举类型
     */
    @ApiModelProperty(value = "枚举类型")
    @Excel(name = "枚举类型")
    private String fieldEnum;
    /**
     * 脱敏方式
     */
    @ApiModelProperty(value = "脱敏方式")
    @Excel(name = "脱敏方式", readConverterExp = "1=可恢复性脱敏,2=不可恢复性脱敏")
    private String sensType;
    /**
     * 加密开始位
     */
    @ApiModelProperty(value = "加密开始位")
    @Excel(name = "加密开始位")
    private String encryStart;
    /**
     * 加密结束位
     */
    @ApiModelProperty(value = "加密结束位")
    @Excel(name = "加密结束位")
    private String encryEnd;
    /**
     * 描述
     */
    @ApiModelProperty(value = "描述")
		@TableField(value = "`describe`")
    @Excel(name = "描述")
    private String describe;

    /**
     * 租户ID
     */
    @ApiModelProperty(value = "租户ID")
    @Excel(name = "租户ID")
    private String tenantId;
    /**
     * 类型格式
     */
    @ApiModelProperty(value = "类型格式")
    @Excel(name = "类型格式")
    private String typeFormat;
    /**
     * xml名称
     */
    @ApiModelProperty(value = "xml名称")
    @Excel(name = "xml名称")
    private String xmlName;
    /**
     * xmlWrapped
     */
    @ApiModelProperty(value = "xmlWrapped")
    @Excel(name = "xmlWrapped")
    private String xmlWrapped;

    /**
     * 是否必填
     */
    @ApiModelProperty(value = "是否必填")
    @Excel(name = "是否必填", readConverterExp = "true=是,false=否")
    private String isRequired;

    /**
     * 数据类型
     */
    @ApiModelProperty(value = "元素类型")
    @Excel(name = "元素类型", readConverterExp = "1=数据元素,2=复合元素，3=结构体")
    private String elementType;
    /**
     * 元素标准分组
     */
    @ApiModelProperty(value = "元素标准分组")
    @Excel(name = "元素标准分组")
    private String elementGroupType;

    /**
     * 业务Id
     */
    private  String businessId;
}
